package com.atguigu.util;

/**
 * @author yhm
 * @create 2022-11-21 14:19
 */
public class MysqlUtil {
    public static String getBaseDicDDL() {
        return "CREATE TABLE base_dic (\n" +
                "  dic_code string,\n" +
                "  dic_name string,\n" +
                "  parent_code string,\n" +
                "  create_time string,\n" +
                "  operate_time string,\n" +
                "  PRIMARY KEY (dic_code) NOT ENFORCED\n" +
                ") " + getMysqlDDL("base_dic");
    }

    public static String getMysqlDDL(String tableName) {
        return "WITH (\n" +
                "   'connector' = 'jdbc',\n" +
                "   'url' = 'jdbc:mysql://hadoop102:3306/gmall',\n" +
                "   'table-name' = '" + tableName + "',\n" +
                "   'username' = 'root',\n" +
                "   'password' = '123456', \n" +
                "   'lookup.cache.max-rows' = '1000', \n" +
                "   'lookup.cache.ttl' = '1 hour', \n" +
                "   'driver' = 'com.mysql.cj.jdbc.Driver' \n" +
                ")";

    }
}
